import server from "../util/request.js";

/**
* 1. 加载指定病人的手术历史
* @param {number} patientId
*/
export function loadPatientSurgeries(patientId) {
    return server({
        url: `/surgery-app/patient/${patientId}`,
        method: 'get'
    })
}

/**
 * 2. 提交新的手术申请
 * @param {object} data (MedSurgeryApplication 实体)
 */
export function submitSurgery(data) {
    return server({
        url: '/surgery-app',
        method: 'post',
        data: data
    })
}

export function updateStatus(data){
    return server({
        url:'/surgery-app',
        method:'put',
        data
    })
}

export function findAll(){
    return server({
        url:'/surgery-app',
        method:'get'
    })
}